package com.monitor.controller.back;

import com.alibaba.fastjson.JSON;
import com.monitor.common.MonitorConstants;
import com.monitor.controller.BaseController;
import com.monitor.vo.GreenChannelReqVo;
import com.monitor.pojo.SysUser;
import com.monitor.service.GreenChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MonitorController
 * @Package com.monitor.controller.back
 * @Description 绿色通道
 * @Author zhixingbai
 * @Create 2018/10/1116:41
 */
@RestController
@RequestMapping("/back")
public class GreenChannelController extends BaseController {
    @Autowired
    private GreenChannelService greenChannelService;

    @RequestMapping(value="/channel",method = RequestMethod.POST)
    public Object sendChannel(GreenChannelReqVo channelVo){
        logger.info("绿色通道请求参数:{}", JSON.toJSONString(channelVo));
        SysUser sysUser=(SysUser)getSessionAttr(MonitorConstants.USER_SESSION_KEY);
        return greenChannelService.toSendGrennChannel(channelVo,sysUser);
    }
}
